package com.example.datn.manager;

import java.util.ArrayList;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

import com.example.datn.objects.AlbumObject;
import com.example.datn.objects.SongObject;

public class ResourceManager {
	
	public static final ResourceManager INSTANCE = new ResourceManager();
	
	NetworkInfo networkInfo = null;
		
	public static boolean hasConnection = false;
	
	public static boolean isNetworkConnected(Context context){
		NetworkInfo networkInfo = null;
		ConnectivityManager conectionManager = 
				(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);		  
		networkInfo = conectionManager.getActiveNetworkInfo();
		if (networkInfo == null || !networkInfo.isConnectedOrConnecting()) {
			hasConnection =  false;
		   return false;
		} else{
			hasConnection = true;
		   return true;
		   }
	}

	public static ResourceManager getInstance(){
		return INSTANCE;
	} 
}
